# QORE_FOUND - system has qore installed
# QORE_INCLUDE_DIR - includes
# QORE_INCLUDE_DIRS - cmake standard alias for QORE_INCLUDE_DIR
# QORE_LIBRARY - library location
# QORE_LIBRARIES - cmake standard alias for QORE_LIBRARY
#
# QORE_MODULES_DIR - location of qore modules
# QORE_API_VERSION - API version
#
# QORE_EXECUTABLE - qore interpret executable
# QORE_QPP_EXECUTABLE - qore qpp executable


if (CMAKE_VERSION VERSION_LESS 2.8.3)
    message(FATAL_ERROR "Qore requires at least CMake version 2.8.3")
endif()

set(QORE_FOUND 1)

set(QORE_INCLUDE_DIR @CMAKE_INSTALL_FULL_INCLUDEDIR@)
set(QORE_INCLUDE_DIRS ${QORE_INCLUDE_DIR})

find_library(QORE_LIBRARY NAMES qore libqore HINTS "@CMAKE_INSTALL_FULL_LIBDIR@/")
set(QORE_LIBRARIES ${QORE_LIBRARY})

set(QORE_MODULES_DIR @MODULE_DIR@)
set(QORE_USER_MODULES_DIR @USER_MODULE_DIR@)
set(QORE_API_VERSION @MODULE_API_MAJOR@.@MODULE_API_MINOR@)

set(QORE_EXECUTABLE @CMAKE_INSTALL_FULL_BINDIR@/qore)
set(QORE_QPP_EXECUTABLE @CMAKE_INSTALL_FULL_BINDIR@/qpp)
set(QORE_QDX_EXECUTABLE @CMAKE_INSTALL_FULL_BINDIR@/qdx)


# warning: the same prefix for current qore is ised if there is no
# CMAKE_INSTALL_PREFIX given
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
    set(CMAKE_INSTALL_PREFIX @myprefix@)
    message(STATUS "Using detected CMAKE_INSTALL_PREFIX: @myprefix@")
endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)


if (NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE "release")
endif (NOT CMAKE_BUILD_TYPE)
string(TOLOWER ${CMAKE_BUILD_TYPE} QORE_BUILD_TYPE_LWR)
if (${QORE_BUILD_TYPE_LWR} MATCHES "debug")
    add_definitions(-DDEBUG)
else ()
    add_definitions(-DNDEBUG)
endif ()


include("${CMAKE_CURRENT_LIST_DIR}/QoreMacros.cmake")

